package ofc4j.util;

import ofc4j.model.elements.LineChart.Dot;

import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.io.path.PathTrackingWriter;

public class DotConverter extends ConverterBase<Dot> {
    @Override
    public void convert(Dot o, PathTrackingWriter writer, MarshallingContext mc) {
        writeNode(writer, "value", o.getValue());
        writeNode(writer, "colour", o.getColour());
        writeNode(writer, "dot-size", o.getDotSize());
        writeNode(writer, "halo-size", o.getHaloSize());
    }

    @Override
    @SuppressWarnings("unchecked")
    public boolean canConvert(Class arg0) {
        return Dot.class.isAssignableFrom(arg0);
    }

}
